@if(Session::has('username'))

<!doctype html>
<html lang="zh">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  <link rel="icon" href="dist/img/favicon-32x32.png" sizes="32x32" type="image/png">
  <link rel="icon" href="dist/img/favicon-16x16.png" sizes="16x16" type="image/png">
  <meta name="keywords" content="keywords">
  <meta name="description" content="description">
  <meta name="author" content="ajiho">
  <link rel="stylesheet" href="lib/bootstrap-icons/font/bootstrap-icons.min.css">
  <link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.min.css">
  <link rel="stylesheet" href="lib/overlayscrollbars/styles/overlayscrollbars.min.css">
  <link rel="stylesheet" href="dist/css/bootstrap-admin.min.css">
  <title>图书管理系统</title>
</head>

<body data-theme="light">
  <!--头部导航-->
  <ul class="bsa-header">
    <!-- 侧边栏触发按钮(移动端时显示) -->
    <li class="bsa-sidebar-toggler" data-bsa-toggle="pushmenu">
      <div class="bsa-header-item">
        <i class="bi bi-list"></i>
      </div>
    </li>
    <!--  搜索组件(不需要可删除)  -->
    <li>
      <div class="bsa-header-item bsa-cursor-default">
        <!--    搜索表单包裹区域        -->
        <div class="bsa-search-form-wrapper" data-bsa-toggle="navbar-search" data-close-reset="false"
          data-action="pages/search.html" data-params='{"type":"article","user":"admin2"}'>
          <div class="bsa-search-form">
            <input type="text" class="form-control bsa-input-search" aria-label="搜索关键词" placeholder="搜索关键词">
            <button class="bsa-search-submit-btn" type="submit"><i class="bi bi-search"></i></button>
            <button class="bsa-search-close-btn" type="button"><i class="bi bi-x-lg"></i></button>
          </div>
        </div>
        <!--    移动端搜索表单触发器(移动端会显示)        -->
        <i class="bi bi-search bsa-search-form-toggler bsa-cursor-pointer"></i>
      </div>
    </li>
    <!--  占位(可以让后面的li居右)  -->
    <li class="flex-grow-1"></li>
    <!--  通知(如果有新消息则添加类名.bsa-has-msg)  -->
    <li>
      <div class="bsa-header-item" data-qt-tab='{"title":"消息中心","url":"pages/message.html"}' data-qt-target=".qtab">
        <i class="bi bi-bell bsa-has-msg"></i>
      </div>
    </li>

    <!--  全屏  -->
    <li class="bsa-fullscreen-toggler">
      <div class="bsa-header-item">
        <i class="bi bi-arrows-fullscreen"></i>
      </div>
    </li>
    <!--  主题配色  -->
    <li class="dropdown">
      <div class="bsa-header-item" data-bs-toggle="dropdown" data-bs-auto-close="outside">
        <i class="bi bi-palette"></i>
      </div>
      <div class="dropdown-menu dropdown-menu-end p-0">
        <div class="card shadow-sm">
          <div class="card-header d-flex justify-content-between bg-body">
            <span class="bsa-fs-15">主题配色</span>
          </div>
          <div class="card-body">
            <!--    配色包裹      -->
            <div class="bsa-theme-switcher-wrapper">
              <input class="form-check-input" type="checkbox" value="light">
              <input class="form-check-input" type="checkbox" value="dark">
              <input class="form-check-input" type="checkbox" value="indigo">
              <input class="form-check-input" type="checkbox" value="green">
              <input class="form-check-input" type="checkbox" value="blue">
              <input class="form-check-input" type="checkbox" value="yellow">
              <input class="form-check-input" type="checkbox" value="pink">
              <input class="form-check-input" type="checkbox" value="red">
              <input class="form-check-input" type="checkbox" value="orange">
              <input class="form-check-input" type="checkbox" value="cyan">
              <input class="form-check-input" type="checkbox" value="teal">
            </div>
          </div>
        </div>
      </div>
    </li>
    <!--    管理员信息    -->
    <li class="dropdown">
      <div class="bsa-header-item" data-bs-toggle="dropdown">
        <div class="bsa-user-area">
          <img src="dist/img/avatar.jpg" class="bsa-user-avatar" alt="用户头像">
          <div class="bsa-user-details">
            <div class="bsa-ellipsis-1 bsa-fs-15">苏柒姑娘</div>
            <!-- 管理员角色RBAC权限设计时可用(不需要可删除,上面的用户名可自动垂直居中)  -->
            <div class="bsa-ellipsis-1 bsa-fs-13 text-muted">超级管理员</div>
          </div>
        </div>
      </div>
      <ul class="dropdown-menu dropdown-menu-end">
        <li>
          <a class="dropdown-item" href="javascript:" data-qt-tab='{"title":"个人资料","url":"pages/profile.html"}'
            data-qt-target=".qtab">
            <i class="bi bi-person me-2"></i>个人资料
          </a>
        </li>
        <li>
          <a class="dropdown-item bsa-clear-cache" href="javascript:"
            data-qt-tab='{"title":"修改密码","url":"pages/password.html"}' data-qt-target=".qtab">
            <i class="bi bi-key me-2"></i>修改密码
          </a>
        </li>
        <li>
          <div class="dropdown-divider"></div>
        </li>
        <li class="bsa-logout"><a class="dropdown-item" href="javascript:"><i
              class="bi bi-box-arrow-right me-2"></i>退出登录</a>
        </li>
      </ul>
    </li>
  </ul>

  <!--侧边栏-->
  <div class="bsa-sidebar">
    <!--  侧边栏头部部分(展示品牌logo)  -->
    <div class="bsa-sidebar-header">
      <img src="dist/img/favicon-32x32.png" class="bsa-logo-icon" alt="logo-icon">
      <div class="bsa-logo-text ms-2 bsa-ellipsis-2">图书管理系统</div>
    </div>
    <!--  侧边栏的身体部分  -->
    <div class="bsa-sidebar-body" data-overlayscrollbars-initialize>
      <!--   侧边栏的菜单     -->
      <ul class="bsa-menu" data-bsa-toggle="sidebar" data-accordion="true" data-click-close="true">
        <li>
          <a href="pages/welcome.html">
            <i class="bi bi-house"></i>首页
          </a>
          
        </li>
        <li>
          <a href="pages/books.html">
            <i></i>图书查询
          </a>
        </li>
        
        <li>
          <a href="pages/user.html">
            <i></i>用户列表
          </a>
        </li>
        <li>
          <a href="pages/Borrowing.html">
            <i></i>借阅记录
          </a>
        </li>
        <!-- <li>
          <a href="">
            <i></i>订单记录
          </a>
        </li> -->



        <!-- <li>
          <a href="javascript:" class="has-children">
            <i class="bi bi-person-lock"></i>权限管理
          </a>
          <ul>
            <li>
              <a href="pages/user.html">用户列表</a>
            </li>

            <li>
              <a href="pages/role.html">角色列表</a>
            </li>
            <li>
              <a href="pages/books.html">图书列表</a>
            </li>
            <li>
              <a href="pages/node.html">节点列表</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="javascript:" class="has-children">
            <i class="bi bi-filetype-html"></i>示例页面
          </a>
          <ul>
            <li>
              <a href="pages/blank.html">新页面</a>
            </li>
            <li>
              target="_self":添加该属性可以让该页面不从tab页面里打开 
              <a href="pages/lockscreen.html" target="_self">锁屏页</a>
            </li>
            <li>
              <a href="pages/gallery.html">图库列表</a>
            </li>
            <li>
              <a href="pages/errors.html">错误页面</a>
            </li>
            <li>
              <a href="pages/login.html" target="_self">登录页面</a>
            </li>
            <li>
              <a href="pages/timeline.html">时间轴</a>
            </li>
            <li>
              <a href="pages/layout1.html">布局示例1</a>
            </li>
            <li>
              <a href="pages/layout2.html">布局示例2</a>
            </li>
            <li>
              <a href="pages/layout3.html">布局示例3</a>
            </li>
          </ul>
        </li>
        <li>
          <a href="javascript:" class="has-children">
            <i class="bi bi-filetype-js"></i>插件
          </a>
          <ul>
            <li><a href="pages/plugin-day.js.html">day.js(时间格式)</a></li>
            <li><a href="pages/plugin-clipboard.html">复制粘贴插件</a></li>
            <li><a href="pages/plugin-shepherd.html">更新引导插件</a></li>
            <li><a href="pages/plugin-fullcalendar.html">日历</a></li>
            <li><a href="pages/plugin-video-js.html">视频播放器</a></li>
            <li><a href="pages/plugin-pickr.html">颜色选择器</a></li>
            <li><a href="pages/plugin-raty-js.html">评分插件</a></li>
            <li><a href="pages/plugin-bootstrap-input-spinner.html">输入框微调插件</a></li>
            <li><a href="pages/plugin-bs-stepper.html">步骤条插件</a></li>
            <li><a href="pages/plugin-sweetalert2.html">sweetalert2</a></li>
            <li><a href="pages/plugin-formvalidation.html">表单验证</a></li>
            <li><a href="pages/plugin-tempus-dominus.html">日期时间</a></li>
            <li><a href="pages/plugin-croppie.html">头像裁剪</a></li>
            <li>
              <a href="javascript:" class="has-children">树形组件</a>
              <ul>
                <li><a href="pages/plugin-ztree.html">ztree</a></li>
              </ul>
            </li>
            <li>
              <a href="javascript:" class="has-children">图表</a>
              <ul>
                <li><a href="pages/plugin-chart.html">chart.js</a></li>
                <li><a href="pages/plugin-echarts.html">echart.js</a></li>
              </ul>
            </li>
            <li>
              <a href="javascript:" class="has-children">数据表格</a>
              <ul>
                <li><a href="pages/plugin-bootstrap-table.html">bootstrap-table</a></li>
                <li><a href="pages/plugin-datatables.html">datatables</a></li>
              </ul>
            </li>
            <li>
              <a href="javascript:" class="has-children">编辑器</a>
              <ul>
                <li><a href="pages/plugin-wangeditor.html">wangeditor</a></li>
              </ul>
            </li>
            <li>
              <a href="javascript:" class="has-children">文件上传</a>
              <ul>
                <li><a href="pages/plugin-bootstrap-fileinput.html">bootstrap-fileinput</a></li>
                <li><a href="pages/plugin-dropzone.html">dropzone</a></li>
              </ul>
            </li>
            <li><a href="pages/plugin-select2.html">select2</a></li>
            <li><a href="pages/plugin-bootstrap-select.html">bootstrap-select</a></li>
            <li><a href="pages/plugin-fonticonpicker.html">图标选择器</a></li>
          </ul>
        </li>
        <li>
          <a href="javascript:" class="has-children">
            <i class="bi bi-gear"></i>设置
          </a>
          <ul>
            <li><a href="pages/sys_website.html">网站设置</a></li>
            <li><a href="pages/sys_email.html">邮件服务</a></li>
          </ul>
        </li>
        <li>
          <a href="docs/index.html" target="_blank">
            <i class="bi bi-filetype-doc"></i>文档
          </a>
        </li>
        <li>
          <a href="javascript:" class="has-children">
            <i class="bi bi-list-nested"></i>多级菜单
          </a>
          <ul>
            <li><a href="pages/multilevel.html?id=1">一级菜单</a></li>
            <li>
              <a href="javascript:" class="has-children">一级菜单</a>
              <ul>
                <li><a href="pages/multilevel.html?id=2">二级菜单</a></li>
                <li>
                  <a href="javascript:" class="has-children">二级菜单</a>
                  <ul>
                    <li><a href="pages/multilevel.html?id=3">三级菜单</a></li>
                    <li>
                      <a href="javascript:" class="has-children">三级菜单</a>
                      <ul>
                        <li><a href="pages/multilevel.html?id=4">四级菜单</a></li>
                        <li>
                          <a href="javascript:" class="has-children">四级菜单</a>
                          <ul>
                            <li><a href="pages/multilevel.html?id=5">五级菜单</a></li>
                            <li><a href="pages/multilevel.html?id=6">五级菜单</a></li>
                          </ul>
                        </li>
                      </ul>
                    </li>
                  </ul>
                </li>
              </ul>
            </li>
            <li>
              <a href="pages/multilevel.html?id=7" class="has-children">一级菜单</a>
              <ul>
                <li><a href="pages/multilevel.html?id=8">二级菜单</a></li>
              </ul>
            </li>
          </ul>
        </li> -->
      </ul>
    </div>
  </div>

  <!--内容区域(用于tab选项卡插件)-->
  <div class="bsa-content">
    <div class="qtab" data-qt-tabs='[{"title":"首页","url":"pages/welcome.html","close":false}]'></div>
  </div>

  <!--版权信息-->
  <div class="bsa-footer">
    <p class="mb-0">图书管理系统</p>
  </div>

  <!--加载层-->
  <div class="bsa-preloader">
    <div class="spinner-border text-secondary" role="status">
      <span class="visually-hidden">Loading...</span>
    </div>
  </div>


  <script src="lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
  <script src="lib/jquery/dist/jquery.min.js"></script>
  <script src="lib/overlayscrollbars/browser/overlayscrollbars.browser.es6.min.js"></script>
  <script src="lib/bootstrap-quicktab/dist/js/bootstrap-quicktab.min.js"></script>
  <script src="dist/js/bootstrap-admin.min.js"></script>
  <script src="dist/js/app.js"></script>
  <!--假数据模拟,生产环境中请直接删除该js-->
  <script src="dist/js/bootstrap-admin.mock.js"></script>

  <script>
    $(function () {

      //头部搜索框处理(不需要可以删除,不明白的可以看bootstrap-admin官方文档)
      $(document).on('search.bsa.navbar-search', function (e, inputValue, data) {
        //先得到请求地址,组合后大概是这样pages/search.html?keyword=dsadsa&type=article&user=admin2
        let url = data.action + '?keyword=' + inputValue + '&' + $.param(data.params);

        //然后通过tab打开一个搜索结果的窗口
        Quicktab.get('.qtab').addTab({
          title: '<i class="bi bi-search"></i><span class="text-danger ms-2">' + inputValue + '</span>',
          url: url,
          close: true,
        })
      })

      //退出登录
      $(document).on('click', '.bsa-logout', function (e) {
        e.preventDefault();

        $.modal({
          body: '确定要退出吗？',
          cancelBtn: true,
          ok: function () {


            //请求退出路由
            $.ajax({
              method: 'post',
              url: '/logout',
            }).then(response => {

              if (response.code === 200) {//跳转到后台首页

                $.toasts({
                  type: 'success',
                  content: '退出成功',
                  onHidden: function () {
                    top.location.replace('/pages/login.html');
                  }
                })
              }
            });


          }
        })


      });
    });
  </script>
</body>

</html>
	
@else
<script type="text/javascript">
  window.location= 'index.php';
</script>
@endif